package com.study.javaBasic.parameter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Name: ParameterMainTest
 * @Description: java类作用描述
 * @Author: yn
 * @CreateDate: 2022/4/19 13:43
 * @Remark: 特殊说明
 * @Version: 1.0
 */
public class ParameterMainTest {
    public static void main(String[] args) throws InterruptedException {
        int intP=258;
        Integer integer=258;
        ParInner inner=new ParInner(258,258);
        StringBuilder str = new StringBuilder();
        List<String> strList = new ArrayList<>();

        System.out.println("-------------------main----------------------");
        System.out.println("intPar = " + intP);
        System.out.println("integerPar = " + integer);
        System.out.println("inner = " + inner);
        System.out.println("str = " + str);
        System.out.println("list:");
        strList.forEach(item-> System.out.println(item));

        Fun(intP,integer,inner, str,strList);

        System.out.println("-------------------main----------------------");
        System.out.println("intPar = " + intP);
        System.out.println("integerPar = " + integer);
        System.out.println("inner = " + inner);
        System.out.println("str = " + str);
        System.out.println("list:");
        strList.forEach(item-> System.out.println(item));
    }

    public static void Fun(int intPar, Integer integerPar, ParInner inner, StringBuilder str, List<String> strList) throws InterruptedException {
//        intPar=123;
//        integerPar=new Integer(123);
//        str=new String("123");
//        inner.setIntegerInner(123);
//        inner.setIntInner(123);
//        inner=new ParInner(123,123);
        intPar++;
        integerPar++;
        str.append("1");
        inner=new ParInner(intPar,integerPar);
        strList.add("Fun");
        System.out.println("-------------------Fun----------------------");
        System.out.println("intPar = " + intPar);
        System.out.println("integerPar = " + integerPar);
        System.out.println("str = " + str);
        System.out.println("inner = " + inner);
        System.out.println("list:");
        strList.forEach(item-> System.out.println(item));
    }

    private static class ParInner{
        private int intInner;
        private Integer integerInner;

        public ParInner(int intInner, Integer integerInner) {
            this.intInner = intInner;
            this.integerInner = integerInner;
        }

        public int getIntInner() {
            return intInner;
        }

        public void setIntInner(int intInner) {
            this.intInner = intInner;
        }

        public Integer getIntegerInner() {
            return integerInner;
        }

        public void setIntegerInner(Integer integerInner) {
            this.integerInner = integerInner;
        }

        @Override
        public String toString() {
            return "ParInner{" +
                    "intInner=" + intInner +
                    ", integerInner=" + integerInner +
                    '}';
        }
    }
}
